<%--
  Created by IntelliJ IDEA.
  User: zzl
  Date: 2020/11/30
  Time: 11:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

<html>
<head>
    <title>z员工列表</title>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>

    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="<%=basePath%>css/navigation.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        $(document).ready(function(){
            $(".click").click(function(){
                $(".tip").fadeIn(200);
            });

            $(".tiptop a").click(function(){
                $(".tip").fadeOut(200);
            });

            $(".sure").click(function(){
                $(".tip").fadeOut(100);
            });

            $(".cancel").click(function(){
                $(".tip").fadeOut(100);
            });

        });
        function DeleteByid(id){
            if(confirm('确认要删除选择的用户吗？')){
                location.href="<%=basePath%>/service/serviceDeleteById?id="+id;
            }
        }
    </script>

</head>
<body>
<div class="container">

    <div class="row">
        <div class="col-md-12">
            <h1 align="center">数据查看</h1>
            <a href="<%=basePath%>/service/daochuStatisticToExcel" style="color: #0099ff;font-size: 20px">数据导出</a>
        </div>

    </div>

    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover table-striped ">
                <tr>
                    <th><a href="<%=basePath%>service/findByName" class="btn btn-primary">真名</a></th>
                    <th><a href="<%=basePath%>service/findByTime" class="btn btn-primary">时间</a></th>
                    <th><a href="<%=basePath%>service/findByDay" class="btn btn-primary">日期</a></th>
                    <th><a href="<%=basePath%>service/findByDay" class="btn btn-primary">纬度</a></th>
                    <th><a href="<%=basePath%>service/findByDay" class="btn btn-primary">经度</a></th>
<%--                    <th><a href="<%=basePath%>service/findByType" class="btn btn-primary">类型</a></th>--%>
<%--                    <th><a href="<%=basePath%>service/findByClass" class="btn btn-primary">种类</a></th>--%>
<%--                    <th><a href="<%=basePath%>service/findByPlace" class="btn btn-primary">地点</a></th>--%>
                    <th><a href="<%=basePath%>service/findByAddress" class="btn btn-primary">地区</a></th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${pageInfo.list}" var="services">
                    <tr>
                        <th>${services.realname}</th>
                        <th>${services.s_time}</th>
                        <th><fmt:formatDate value="${services.s_day}" pattern="yyyy-MM-dd"  /> </th>
<%--                        <th>${services.s_type}</th>--%>
<%--                        <th>${services.s_class}</th>--%>
<%--                        <th>${services.s_place}</th>--%>
                        <th>${services.s_lng}</th>
                        <th>${services.s_lat}</th>
                        <th>${services.s_address}</th>
                        <th>
                        <button type="button" class="btn btn-danger"  onclick="DeleteByid(${services.id})" >处理订单</button>
                    </th>
                    </tr>
                </c:forEach>

            </table>
            <div class="box">
                <div id="pagination" class="page center">
                </div>
            </div>

        </div>
        <div class="row">
            <%--           分页文字信息--%>
            <div class="col-md-6">
                当前${pageInfo.pageNum}页,总共${pageInfo.pages}页,共${pageInfo.total}条记录
            </div>

            <div class="col-md-6">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li><a href="<%=basePath%>service/list?pn=1">首页</a></li>

                        <c:if test="${pageInfo.hasPreviousPage}">
                            <li>
                                <a href="<%=basePath%>service/list?pn=${pageInfo.pageNum-1}" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                        </c:if>

                        <c:forEach items="${pageInfo.navigatepageNums}" var="page_Num">
                            <c:if test="${page_Num == pageInfo.pageNum}">
                                <li class="active"><a href="#">${page_Num }</a></li>
                            </c:if>
                            <c:if test="${page_Num != pageInfo.pageNum}">
                                <li><a href="<%=basePath%>service/list?pn=${page_Num }">${page_Num }</a></li>
                            </c:if>

                        </c:forEach>

                        <c:if test="${pageInfo.hasNextPage}">
                            <li> <a href="<%=basePath%>service/list?pn=${pageInfo.pageNum+1 }" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a></li>
                        </c:if>

                        <li><a href="<%=basePath%>service/list?pn=${pageInfo.pages}">末页</a></li>
                    </ul>
                </nav>
            </div>

        </div>
    </div>


</div>
</body>
</html>
